/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Controle;

import java.sql.Statement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author Rafael
 */
public class Conexao {

    private Connection conn;

    public Conexao() throws SQLException {
        String url = "jdbc:postgresql://dev.ct.utfpr.edu.br:5432/aluno15";
        String username = "aluno15";
        String pass = "aluno15";

        try {
            Class.forName("org.postgresql.Driver");
            conn = DriverManager.getConnection(url, username, pass);
            System.out.println("OK!");
        } catch (Exception e) {
            e.printStackTrace();
        }
        Statement stmt = conn.createStatement();
        stmt.execute("SET search_path TO brtokrtvidal;");
    }

    public Connection getConnection() {
        return conn;
    }
}